/*
 * StoreMarcadorAction.java
 *
 * Created on 12 de noviembre de 2007, 9:07
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package webportlet.model.portletfacade.plain.action;

import java.sql.Connection;
import webportlet.model.marcador.dao.SQLMarcadorDAO;
import webportlet.model.marcador.dao.SQLMarcadorDAOFactory;
import webportlet.model.marcador.dto.MarcadorDTO;
import webportlet.model.util.DuplicateInstanceException;
import webportlet.model.util.InstanceNotFoundException;
import webportlet.model.util.InternalErrorException;
import webportlet.model.portletfacade.util.PasswordEncrypter;
import webportlet.model.util.TransactionalPlainAction;

/**
 *
 * @author Alvarete
 */
public class CreateMarcadorAction implements TransactionalPlainAction {

    
    private MarcadorDTO marcadorDTO;

    public CreateMarcadorAction(MarcadorDTO marcadorDTO) {
        
        this.marcadorDTO = marcadorDTO;
    }
        

    public Object execute(Connection connection) 
        throws InstanceNotFoundException, DuplicateInstanceException, 
               InternalErrorException {
                
        SQLMarcadorDAO marcadorDAO = SQLMarcadorDAOFactory.getDAO();
        return marcadorDAO.create(connection, marcadorDTO);   
    }    
}
